package com.hdoit.apollo.logical.cargo.dao.impl;

import org.springframework.stereotype.Component;

import com.hdoit.apollo.logical.cargo.dao.ICategoryDao;
import com.hdoit.apollo.logical.cargo.model.Category;
import com.tennetcn.data.dao.base.ISqlExpression;
import com.tennetcn.data.dao.base.impl.SuperDao;
import com.tennetcn.data.utils.SqlExpressionFactory;
/**
 * @author      humaoshu
 * @email       
 * @createtime  2018年03月31日 16:33:17
 * @comment
 */
@Component
public class CategoryDaoImpl extends SuperDao<Category> implements ICategoryDao{

	@Override
	public boolean deleteCategory(String categoryId) {
		ISqlExpression sqlExpression = SqlExpressionFactory.createExpression();
		sqlExpression.addBody("delete from",Category.class)
					.andWhere("categoryId=#{categoryId}")
					.setParam("categoryId", categoryId);
		return delete(sqlExpression)>=0;
	}

}